﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data.Common;
using System.Diagnostics;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Data;

namespace MSharp.Data.UnitTestProject
{

    public static class DbProviderFactoryExt
    {
        public static void CreateParameter(this DbProviderFactory dbFactory,string parame)
        {

        }
    }

    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            var db = DBMgr.Connect(DBType.SqlServer);

            var info = db.Info;

            
            
           
           


            List<IDataParameter> lstDp2 = new List<IDataParameter>();

           


            //var conn = db.CreateConn();
            //conn.Open();

            
  


        }





        [TestMethod]
        public void TestMethod4()
        {
            Person per = new Person() { Name = "xiaoqiang", Age = 20 };

            Console.WriteLine(new Action(() =>
            {
                Type ty = per.GetType();
                var props = ty.GetProperties();

            }).ForWatchMs(50000000000));


            //效率慢
            Console.WriteLine(new Action(() =>
            {
                var props = TypeDescriptor.GetProperties(per);

            }).ForWatchMs(50000000000));

        }
    }


    public class Person
    {
        public static string str
        {
            get; set;
        }

        public Person()
        {
            str = new Random().NextDouble().ToString();
        }
        public string Name { get; set; }

        public int Age { get; set; }
    }

    public class ChinaPerson
    {
        public ChinaPerson()
        {

        }

        public int Id { get; set; }

        public Person Per { get; set; }
    }
}
